import request from '~/utils/request';

//添加空商品记录
export function addSpRecord(data) {
    return request({
        url: '/Product/AddSpRecord',
        method: 'post',
        data,
    });
}

//按类型从种类中获取产品列表
export function getProductListFromKindByType(data) {
    return request({
        url: '/Product/GetProductListFromKindByType',
        method: 'post',
        data,
    });
}

//获取商品所有列表
export function getProductAllList(data) {
    return request({
        url: '/Product/GetProductAllList',
        method: 'post',
        data,
    });
}

//获取商品分页列表
export function getSpList(data) {
    return request({
        url: '/Product/GetSpList',
        method: 'post',
        data,
    });
}

//获取商品编辑信息
export function getProductEditInfo(data) {
    return request({
        url: '/Product/GetProductEditInfo',
        method: 'post',
        data,
    });
}

//获取商品编辑信息
export function getProductEditInfoApi(data) {
    return request({
        url: '/Product/GetProductEditInfoApi',
        method: 'post',
        data,
    });
}

//获取商品属性参数列表
export function getProductParamList(data) {
    return request({
        url: '/Product/GetProductParamList',
        method: 'post',
        data,
    });
}

//获取商品属性参数母板及列表
export function getProductAttrParamList(data) {
    return request({
        url: '/Product/GetProductAttrParamList',
        method: 'post',
        data,
    });
}

//获取商品展示图片列表
export function getProductShowPicList(data) {
    return request({
        url: '/Product/GetProductShowPicList',
        method: 'post',
        data,
    });
}

//保存修改后的商品展示图片列表
export function updateProductLogoList(data) {
    return request({
        url: '/Product/UpdateProductLogoList',
        method: 'post',
        data,
    });
}

//保存商品属性
export function saveProductParamList(data) {
    return request({
        url: '/Product/SaveProductParamList',
        method: 'post',
        data,
    });
}

//保存商品富文本
export function saveProductHtml(data) {
    return request({
        url: '/Product/SaveProductHtml',
        method: 'post',
        data,
    });
}

//获取商品富文本
export function getProductHtml(data) {
    return request({
        url: '/Product/GetProductHtml',
        method: 'post',
        data,
    });
}

//获取商品基本信息
export function getProductBaseInfo(data) {
    return request({
        url: '/Product/GetProductBaseInfo',
        method: 'post',
        data,
    });
}

//获取商品图标选择列表
export function getProductLogoSelectList(data) {
    return request({
        url: '/Product/GetProductLogoSelectList',
        method: 'post',
        data,
    });
}

//获取商品种类选择列表
export function getProductKindSelectList(data) {
    return request({
        url: '/Product/GetProductKindSelectList',
        method: 'post',
        data,
    });
}

//发布商品(上架)
export function setProductState(data) {
    return request({
        url: '/Product/SetProductState',
        method: 'post',
        data,
    });
}

//设置商品持有者
export function setProductHold(data) {
    return request({
        url: '/Product/SetProductHold',
        method: 'post',
        data,
    });
}

//获取商品种类编辑列表
export function getProductKindEditList(data) {
    return request({
        url: '/Product/GetProductKindEditList',
        method: 'post',
        data,
    });
}

//获取商品种类编辑列表
export function getProductKindAddInitInfo(data) {
    return request({
        url: '/Product/GetProductKindAddInitInfo',
        method: 'post',
        data,
    });
}

//保存新增或修改后的商品种类信息
export function saveProductKind(data) {
    return request({
        url: '/Product/SaveProductKind',
        method: 'post',
        data,
    });
}

//获取商品促销列表
export function getProductPromotionList(data) {
    return request({
        url: '/Product/GetProductPromotionList',
        method: 'post',
        data,
    });
}

//获取商品促销详情
export function getProductPromotionInfo(id) {
    return request({
        url: '/Product/GetProductPromotionInfo?pp_id=' + id,
        method: 'get',
    });
}

//保存商品促销数据
export function saveProductPromotion(data) {
    return request({
        url: '/Product/SaveProductPromotion',
        method: 'post',
        data,
    });
}

//修改商品促销状态
export function setProductPromotionState(data) {
    return request({
        url: '/Product/SetProductPromotionState',
        method: 'post',
        data,
    });
}

//获取Ftp服务器基址
export function getFtpBaseUsr() {
    return request({
        url: '/Product/GetFtpBaseUsr',
        method: 'get',
    });
}

//获取Ftp服务器基址
export function delDraftProduct(data) {
    return request({
        url: '/Product/DelDraftProduct',
        method: 'post',
        data,
    });
}

//设置赠品自购切换
export function setOwnerShow(data) {
    return request({
        url: '/Product/SetOwnerShow',
        method: 'post',
        data,
    });
}

//保存指定商品的序号
export function setProductDataOrderNum(data) {
    return request({
        url: '/Product/SetProductDataOrderNum',
        method: 'post',
        data,
    });
}

//保存指定商品的序号
export function saveDownPics(data) {
    return request({
        url: '/Product/SaveDownPics',
        method: 'post',
        data,
    });
}

//获取商品广告可下载列表
export function getDownPicList(data) {
    return request({
        url: '/Product/GetDownPicList',
        method: 'post',
        data,
    });
}

//获取商品检查列表
export function GetProductVerifyList(data) {
    return request({
        url: '/Product/GetProductVerifyList',
        method: 'post',
        data,
    });
}
//获取商品日志列表
export function GetProductLogList(data) {
    return request({
        url: '/Product/GetProductLogList',
        method: 'post',
        data,
    });
}
//获取商品根据FactoryID
export function GetProductListByFactoryID(data) {
    return request({
        url: '/Product/GetProductListByFactoryID',
        method: 'post',
        data,
    });
}
//获取商品统计
export function GetProductListMerchantCount(data) {
    //console.log(data)
    return request({
        url: '/Product/GetProductListMerchantCount',
        method: 'post',
        data,
    });
}
//获取商品一级分类
export function GetOneKindList(data) {
    //console.log(data)
    return request({
        url: '/Product/GetOneKindList',
        method: 'post',
        data,
    });
}
//修改商品的厂家
export function SaveProductDataFactory(data) {
    //console.log(data)
    return request({
        url: '/Product/SaveProductDataFactory',
        method: 'post',
        data,
    });
}
//判断商品是否有权限
export function IsExistAuto(data) {
    //console.log(data)
    return request({
        url: '/Product/IsExistAuto',
        method: 'post',
        data,
    });
}
//设置运费模板
export function SaveFreightData(data) {
    return request({
        url: '/Product/SaveFreightData',
        method: 'post',
        data,
    });
}
//查询单个运费模板
export function GetFreightData(data) {
    return request({
        url: '/Product/GetFreightData',
        method: 'post',
        data,
    });
}
//运费模板列表
export function GetFreightPagedList(data) {
    return request({
        url: '/Product/GetFreightPagedList',
        method: 'post',
        data,
    });
}
//修改运费模板明细状态
export function SetFreightParamState(data) {
    return request({
        url: '/Product/SetFreightParamState',
        method: 'post',
        data,
    });
}

//根据商品属性查询商品列表
export function getSpCardListByPriceDiscount(data) {
    return request({
        url: '/Product/GetSpCardListByPriceDiscount',
        method: 'post',
        data,
    });
}
